package the.workshop.milktea.infrastructure.common;

import lombok.Getter;

import java.util.Arrays;

public enum ProductTypeEnum {
    A(1, "真抹茶莱莉"),
    B(2, "真抹茶芝士奶昔"),
    C(3, "牛油果卡士酸奶"),
    D(4, "牛油果椰椰"),
    E(5, "茉莉绿 "),
    F(6, "桂花乌龙"),
    G(7, "三无红糖珍珠奶茶"),
    H(8, "纯奶三无红糖珍珠"),
    I(9, "茉莉三无红糖珍珠"),
    J(10, "三无荔浦芋泥椰"),
    K(11, "锡兰红"),
    L(12, "高山乌龙茶"),
    M(13, "红玉"),
    N(14, "芒果莱莉绿"),
    O(15, "杨枝甘露 "),
    P(16, "手剥粒粒桑葚"),
    Q(17, "手剥粒粒葡萄"),
    R(18, "生榨椰椰"),
    AS(19, "牛油果甘露"),
    AT(20, "手捣丹东草莓"),
    AU(21, "芒芒冻冻"),
    AV(22, "满杯红西柚"),
    AW(23, "暴打广东香水柠檬。 "),
    AX(24, "雪顶锡兰红"),
    AY(25, "雪顶红玉"),
    AZ(26, "芝士手剥葡萄 "),
    AA(27, "芝士手剥桑葚"),
    AB(28, "芝士丹东草莓"),
    AC(29, "红玉纯茶"),
    AD(30, "芝士红玉纯茶"),
    AE(31, "茉莉纯茶"),
    AF(32, "芝士茉莉纯茶");

    @Getter
    private Integer code;

    @Getter
    private String name;

    ProductTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(int code) {
        return Arrays.stream(ProductTypeEnum.values()).filter(it -> it.getCode() == code).findFirst().get().getName();
    }
}
